Self-triggering outgoing buffers

ABSTRACT

A buffer output manager facilitates automatic self-triggering output of buffer contents. At least one processes writes control data to at least one buffer, the control data being such that a buffer output trigger address can be determined therefrom. For each buffer to which control data is written, a buffer output manager determines the trigger address of that buffer. At least one process writes data to at least one buffer, including to the trigger address thereof. For each buffer to which data is written to the trigger address, the buffer output manager automatically outputs the contents of that buffer, responsive to the writing of the data to the trigger address.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority under 35 U.S.C. § 119(e) from U.S.Provisional Patent Application Ser. No. 60/574,402, filed May 25, 2004,and from U.S. Provisional Patent Application Ser. No. 60/599,565, filedAug. 5, 2004. The entirety of each of these provisional patentapplications is incorporated herein by reference.

BACKGROUND

1. Field of Invention

The present invention relates generally to efficient buffer managementin a computer system, and more specifically to automaticallyself-triggering the outbound processing of buffer contents.

2. Background of Invention

The speed and efficiency of an integrated circuit or computer program isaffected by the efficiency of the processing of buffer output. Bothhardware and software architectures frequently involve large numbers ofbuffers, to which various data are written during system operation. Thecontents of these buffers are then output to various destinations.Because of the large number of buffers potentially involved in a system,even relatively minor inefficiencies in output management can introducesubstantial latency.

In the prior art, buffer output is typically managed by first writingdata to a buffer, and then initiating a start operation to begin theoutput processing, once the buffer is full. This method works, but usesdedicated clock cycles to begin the output processing, thereby takinglonger than would be desirable.

A prior art method designed to speed up such operations involves usingdirect memory access to write data to a destination, but this stillintroduces some latency in the form of the overhead involved in thedirect memory access operation. Furthermore, using direct memory accessadds a great deal of complexity. This is especially true where multipleprocessors are being used, in which case the coordination of the directmemory access and the processors becomes extremely complex, and thusprone to error.

What is needed are methods, computer systems and integrated circuits toefficiently manage buffer output without introducing unnecessary latencyor involving the inherent complexity of direct memory access.

SUMMARY OF INVENTION

Methods, computer systems and integrated circuits facilitate automaticself-triggering output of buffer contents. At least one processes writescontrol data to at least one buffer, the control data being such that abuffer output trigger address can be determined therefrom. For eachbuffer to which control data is written, a buffer output managerdetermines the trigger address of that buffer from the control data. Atleast one process writes data to at least one buffer, including to thetrigger address thereof. For each buffer to which data is written to thetrigger address, the buffer output manager automatically outputs thecontents of that buffer, responsive to the writing of the data to thetrigger address. In some embodiments, a plurality of processes write toa plurality of buffers in parallel, and the buffer output manageroutputs buffer contents in order for each process, based on the order inwhich that process wrote to the trigger addresses of the various buffersbeing output.

The features and advantages described in this summary and the followingdetailed description are not all-inclusive, and particularly, manyadditional features and advantages will be apparent to one of ordinaryskill in the art in view of the drawings, specification, and claimshereof. Moreover, it should be noted that the language used in thespecification has been principally selected for readability andinstructional purposes, and may not have been selected to delineate orcircumscribe the inventive subject matter, resort to the claims beingnecessary to determine such inventive subject matter.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating a high level overview of a systemfor practicing some embodiments of the present invention.

FIG. 2 is a block diagram illustrating an example of a process writingto a plurality of buffers in parallel, according to one embodiment ofthe present invention.

FIG. 3 is a block diagram illustrating an example of a buffer, accordingto one embodiment of the present invention.

The figures depict embodiments of the present invention for purposes ofillustration only. One skilled in the art will readily recognize fromthe following discussion that alternative embodiments of the structuresand methods illustrated herein may be employed without departing fromthe principles of the invention described herein.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

FIG. 1 illustrates a high level overview of a system 100 for practicingsome embodiments of the present invention. A buffer output manager 101facilitates the automatic self-triggering of the outbound processing ofthe content 103 of at least one buffer 105, according to someembodiments of the present invention. It is to be understood thatalthough the buffer output manager 101 is illustrated as a singleentity, as the term is used herein a buffer output manager 101 refers toa collection of functionalities which can be implemented as hardware,software, firmware or any combination of these. Where a buffer outputmanager 101 is implemented as software, it can be implemented as astandalone program, but can also be implemented in other ways, forexample as part of a larger program or as a plurality of separateprograms. Additionally, buffers 105 can be instantiated in software,hardware, firmware or any combination of these.

As illustrated in FIG. 1, a process 107 writes control data 109 to abuffer 105. The control data 109 comprises at least information fromwhich an output trigger address 111 for the buffer 105 can bedetermined. When data 113 is written to a buffer's 105 output triggeraddress 111, the buffer output manager 101 automatically processes theoutput of that buffer 105. An example of an output trigger address 111is the address of the last word of the buffer 105. The control data 109can, for example, comprise the size of the buffer, or the output triggeraddress 111 itself. The control data 109 can but need not compriseadditional information, such as interrupt logic, loopback logic, etc.

For each buffer 105 to which control data 109 is written, the bufferoutput manager 101 determines the trigger address 111 of that buffer 105from the control data 109. For example, depending upon the format of thecontrol data 109, the buffer output manager 101 can add the buffer sizeto the starting address of the buffer 105 to calculate the triggeraddress 111, or simply read the trigger address 111 from the controldata 109 itself.

As noted above, when a process 107 writes data 113 to the triggeraddress 111 of a buffer 105, the buffer output manager 101 automaticallyprocesses outputting the content 113 of that buffer 105, responsive tothe writing of the data 113 to the trigger address 111.

As illustrated in FIG. 2, it is to be understood that one or moreprocesses 107 can write to a plurality of buffers 105 in parallel,and/or in any order. The buffer output manager 101 outputs buffer 105contents 103 in the order in which data 113 is written to the associatedtrigger addresses 111. For example, in some embodiments as illustratedin FIG. 2, whenever data 113 is written to the trigger address 111 of abuffer 105, the buffer output manager 101 stores an identifier 201 forthe buffer 105 (e.g., a buffer number or name) in a First In-First OutQueue 203, and executes the outbound processing of buffers 105 in queuedorder. Thus, when a buffer 105 is filled (i.e., data is written to itstrigger address), the buffer 105 is queued for outbound processing. Inthe example illustrated in FIG. 2, the three buffers 105 are filled inthe order 2, 1, 3, and the buffer output manager 101 writescorresponding identifiers 201 to the queue 203 accordingly. As describedabove, the buffer output manager 101 outputs the contents 103 of thebuffers 105 in queued order. Of course, in other embodiments, mechanismsother than queues 203 can be utilized to maintain this ordering.

In some embodiments, each process 107 of a plurality 107 of processes107 (not illustrated) can write to multiple buffers 105 in parallel. Insuch embodiments, for each process 107, the buffer output manager 101facilitates the outbound processing of buffers 105 written to by thatprocess 107 in the order in which data 113 is written to the associatedtrigger addresses 111. For example, in embodiments in which the bufferoutput manager 101 utilizes a First In-First Out Queue 203 to manageoutput ordering, the buffer output manager 101 would maintain a separatequeue 203 (not illustrated) for each process 107, and thus maintainordering for outputting buffers 105 at a process 107 level.

In some embodiments of the present invention, a process 107 writes data113 to addresses in a buffer 105 other than the trigger address 111, andsubsequently writes data 113 to the trigger address 111 to cause thebuffer output manager 101 to output the contents 103 of the buffer 105.It is to be understood that a process 107 can write data 113 to anyaddress of a buffer 105, in any order. In some embodiments, a process107 can repeatedly write data 113 to the trigger address 111 of a buffer103, thereby causing the buffer output manager 101 to output thecontents 103 of the buffer 105 multiple times. In some embodiments, aprocess 107 can use write combining to fill a buffer 105 with acontiguous block of data 113, rather than performing a series ofindividual write operations. Where the buffer 105 addresses to which thecontiguous block of data 113 is written include the trigger address 111,the buffer output manager 101 automatically outputs the contents 103 ofthe buffer 105 in response.

In some embodiments of the present invention, when a process 107 writescontrol data 109 to a buffer 105, the buffer output manager 101 locksthe buffer 105 such that only the writing process 107 can access thebuffer 105. In such embodiments, the buffer output manager 101 unlocksthe buffer 105 after the process 107 has written to the trigger address111, and the contents 103 of the buffer 105 has been output. Thislocking functionality keeps other processes 107 from corrupting a buffer105 as a process 107 is writing thereto.

In some embodiments of the present invention, the buffer output manager101 uses write combining to output the contents 103 of a buffer 105 as acontiguous block, rather than performing a series of individual writeoperations. This saves time and processing cycles. In other embodiments,the buffer output manager 101 simply uses a plurality of writeoperations to output buffer 105 contents 103.

FIG. 3 illustrates an example of a buffer 105, according to someembodiments of the present invention. Control data 109 is located (forexample) at the head of the buffer 105, and includes (in this example)the size 301 of the buffer 105. A data to write area 303 follows thecontrol information 109. Processes 107 can write data 113 to this area303, which will be output in response to data 113 being written to thetrigger address 111. In the example illustrated in FIG. 3, the triggeraddress 111 comprises the last word of the data to write area 303.

In some embodiments of the present invention, the buffers 105 and bufferoutput manager are instantiated as part of an integrated circuit, but itis to be understood that they can be implemented on other types ofcomputing devices as well, such as personal computers, routers,firewalls, etc. In some embodiments of the present invention, at leastsome of the processes 107 that write to the buffers 105 are located oncomputing devices external to the integrated circuit (or other computingdevice) on which the buffers 105 are located. In other embodiments, theprocesses 107 and the buffers 105 are located on the same computingdevice.

As will be understood by those familiar with the art, the invention maybe embodied in other specific forms without departing from the spirit oressential characteristics thereof. Likewise, the particular naming anddivision of the modules, portions, managers, features, attributes,methodologies and other aspects are not mandatory or significant, andthe mechanisms that implement the invention or its features may havedifferent names, divisions and/or formats. Furthermore, as will beapparent to one of ordinary skill in the relevant art, the modules,managers, portions, features, attributes, methodologies and otheraspects of the invention can be implemented as software, hardware,firmware or any combination of the three. Of course, wherever acomponent of the present invention is implemented as software, thecomponent can be implemented as a standalone program, as part of alarger program, as a plurality of separate programs, as a statically ordynamically linked library, as a kernel loadable module, as a devicedriver, and/or in every and any other way known now or in the future tothose of skill in the art of computer programming. Additionally, thepresent invention is in no way limited to implementation in any specificprogramming language, or for any specific operating system orenvironment. Accordingly, the disclosure of the present invention isintended to be illustrative, but not limiting, of the scope of theinvention, which is set forth in the following claims.

1. A method for self-triggering output of buffer contents, the methodcomprising: writing, to at least one buffer, control data from which abuffer output trigger address can be determined; for each buffer towhich control data is written, determining a trigger address of thatbuffer from the control data; writing data to the trigger address of atleast one buffer; for each buffer to which data is written to thetrigger address, automatically outputting contents of that bufferresponsive to the writing of the data to the trigger address; locking abuffer once control data is written thereto, such that only a writingprocess can access the buffer; and unlocking the buffer after thecontents of the buffer has been output.
 2. A computer system forself-triggering output of buffer contents, the computer systemcomprising: a portion configured to write, to at least one buffer,control data from which a buffer output trigger address can bedetermined; a portion configured to, for each buffer to which controldata is written, determine a trigger address of that buffer from thecontrol data; a portion configured to write data to the trigger addressof at least one buffer; for each buffer to which data is written to thetrigger address a portion configured to automatically output contents ofthat buffer responsive to the writing of the data to the triggeraddress; a portion configured to lock a buffer once control data iswritten thereto, such that only a writing process can access the buffer;and a portion configured to unlock the buffer after the contents of thebuffer has been output.
 3. A method for self-triggering output of buffercontents, the method comprising: at least one buffer receiving controldata from which a buffer output trigger address can be determined; foreach buffer which receives control data, determining a trigger addressof that buffer from the control data; at least one buffer receiving dataat its trigger address; for each buffer which receives data at itstrigger address, automatically outputting contents of that bufferresponsive to the writing of the data to the trigger address; locking abuffer responsive to control data being received thereby, such that onlya writing process from which the control data was received can accessthe buffer; and unlocking the buffer after the contents of the bufferhas been output.